package com.jake.spring.cloud.kafka.stomp1.controller;

import com.jake.spring.cloud.kafka.stomp1.constant.AllConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("screen")
public class ScreenController {

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    @PostMapping("message")
    public void pushMessage(String msg) {
        kafkaTemplate.send(AllConstants.KAFKA_LISTENING_TOPIC, "kafka1: " + msg);
    }

}
